function f = splice_data(DATA)
% Decreasing priority
% Only deal with data with NaNs either in the beginning or end or both
[~ , K] = size(DATA);

f = DATA(: , 1);
for i = 2 : K
    nan_idx = isnan(f);
    f(nan_idx) = DATA(nan_idx , i);
end

end